/*
 * @Author: guo wei
 * @LastEditors: [guo wei]
 * @LastEditTime: 2024-01-17 22:19:59
 * @Description: 
 */
import request from '@/utils/request'

// 查询材料商列表
export function getMaterialSupplierInfos(query) {
  return request({
    url: '/materialSupplierInfos',
    method: 'get',
    params: query
  })
}
// 新增材料商
export function addMaterialSupplierInfo(data) {
  return request({
    url: `/materialSupplierInfo`,
    method: 'post',
    data
  })
}
// 修改材料商
export function modifyMaterialSupplierInfo(data) {
  return request({
    url: `/materialSupplierInfo`,
    method: 'put',
    data
  })
}
// 删除材料商
export function deleteMaterialSupplierInfo(data) {
  return request({
    url: `/materialSupplierInfo/${data.materialSupplierInfoId}`,
    method: 'delete',
       params:{recordVersion:data.recordVersion}
  })
}
//查询所有材料分类列表
export function allMaterialCategoryInfo(query) {
  return request({
    url: '/allMaterialCategoryInfo',
    method: 'get',
    params: query
  })
}
//生成邀请码
export function getGenerateInvitationCode(query) {
  return request({
    url: '/materialSupplierInfo/generateInvitationCode',
    method: 'get',
    params: query
  })
}
//上架材料商
export function putOnMaterialSupplierInfoByAdmin(data) {
  return request({
    url: `/materialSupplierInfo/putOn`,
    method: 'post',
    data
  })
}
export function putOnMaterialSupplierInfo(data) {
  return request({
    url: `/materialSupplierInfo/putOn`,
    method: 'post',
    data
  })
}
// export function putOnMaterialSupplierInfoByAdmin(data) {
//   return request({
//     url: `/materialSupplierInfo/adminPutOn`,
//     method: 'post',
//     data
//   })
// }
// 提交材料商
export function submitMaterialSupplierInfo(data) {
  return request({
    url: `/materialSupplierInfo/submit`,
    method: 'post',
    data
  })
}
//审核材料商
export function examineMaterialSupplierInfo(data) {
  return request({
    url: `/materialSupplierInfo/audit`,
    method: 'post',
    data:data.materialSupplierInfoIds,
    params:{isPass:data.isPass,reason:data.reason}
  })
}
//下架材料商
export function putOffMaterialSupplierInfo(data) {
  return request({
    url: `/materialSupplierInfo/putOff`,
    method: 'post',
    data
  })
}

// 新增材大类
export function addMaterialCategoryInfo(data) {
  return request({
    url: `/materialCategoryInfo`,
    method: 'post',
    data
  })
}
// 修改材料大类
export function modifyMaterialCategoryInfo(data) {
  return request({
    url: `/materialCategoryInfo`,
    method: 'put',
    data
  })
}
// 删除材料大类
export function deleteMaterialCategoryInfo(data) {
  return request({
    url: `/materialCategoryInfo/${data.materialCategoryInfoId}`,
    method: 'delete',
       params:{recordVersion:data.recordVersion}
  })
}
